<?php
/* @var $this MatchingHistoryController */
/* @var $model MatchingGenerationForm */
/* @var $form CActiveForm */
?>
<?php
$this->layout = "//layouts/column1";
$this->pageTitle = Yii::app()->name . ' - Matching Generation';
?> 
<h1>New Matching Generation</h1>
<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'matching-generation-form',
        'enableAjaxValidation' => false,
            ));
    ?>
    <div style="margin-bottom: 25px;">
        <span>Preview matching calculation (user wise). Please check carefully and submit request for matching generation</span>
        <span style="float: right">
<?php echo CHtml::submitButton('Submit Matching Request', array('class' => 'matching-generation-button', 'onclick'=>'return confirm(\'Do you really want to submit the matching request?\');')); ?>
        </span>
    </div>
    <div style="text-align: center; margin-bottom: 10px">
        <span>Matching Slot: </span>
        <?php
            foreach ($model->slotList as $slot){
                ?>
        <span style="padding: 2px 5px; border: 1px solid skyblue;"><?php echo $slot['point']; ?></span>   
                 <?php
            }
        ?>
    </div>
    <table class="matching-table">
        <tr>
            <th>member id</th>
            <th>username</th>
            <th>a point</th>
            <th>b point</th>
            <th>matching slot</th>
            <th>package</th>
            <th>package price</th>
            <th>package point</th>
            <th>max point</th>
            <th class="red">earned amount</th>
            <th>new A point</th>
            <th>new B point</th>
            <th>date</th>
        </tr>

        <?php
        foreach ($model->matchingList as $matching) {
            ?>

            <tr>
                <td><?php echo $matching->member_id; ?></td>
                <td><?php echo $matching->username; ?></td>
                <td><?php echo $matching->aPoint; ?></td>
                <td><?php echo $matching->bPoint; ?></td>
                <td><?php echo $matching->matching_slot; ?></td>
                <td><?php echo $matching->package; ?></td>
                <td><?php echo $matching->package_price; ?></td>
                <td><?php echo $matching->package_point; ?></td>
                <td><?php echo $matching->max_point; ?></td>
                <td class="red"><?php echo $matching->earned_amount; ?></td>
                <td><?php echo $matching->newAPoint; ?></td>
                <td><?php echo $matching->newBPoint; ?></td>
                <td><?php echo $matching->date; ?></td>
            </tr>    


            <?php
        }
        ?>
    </table>
<?php $this->endWidget(); ?>

</div>